<%--
  Created by IntelliJ IDEA.
  User: cos
  Date: 2022/3/3
  Time: 15:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fm" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="https://fastly.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"
            integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
            crossorigin="anonymous"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
            integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd"
            crossorigin="anonymous"></script>
</head>
<body>


<div class="container">
    <div class="row">
        <div class="col-md-12">
            <table class="table table-bordered table-hover">
                <thead>
                <tr>
                    <td>employeeId</td>
                    <td>firstName</td>
                    <td>lastName</td>
                    <td>email</td>
                    <td>phoneNumber</td>
                    <td>hireDate</td>
                    <td>jobId</td>
                    <td>salary</td>
                    <td>commissionPct</td>
                    <td>managerId</td>
                    <td>departmentName</td>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${pi.list}" var="e">
                    <tr>
                        <td>${e.employeeId}</td>
                        <td>${e.firstName}</td>
                        <td>${e.lastName}</td>
                        <td>${e.email }</td>
                        <td>${e.phoneNumber}</td>
                        <td>
                            <fm:formatDate value="${e.hireDate}" pattern="yyyy-MM-dd"/>
                        </td>
                        <td>${e.jobId }</td>
                        <td>${e.salary}</td>
                        <td>${e.commissionPct}</td>
                        <td>${e.managerId}</td>
                        <td>${e.dept.departmentName}</td>
                    </tr>
                </c:forEach>
                </tbody>
                <tfoot>
                <tr class="text-center">
                    <td colspan="11">



                        <nav aria-label="Page navigation">
                            <ul class="pagination">
                                <li>
                                    <a href="/emp?pageNum=1" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="/emp?pageNum=${pi.prePage}">上一页</a>
                                </li>

                                <c:forEach end="${pi.navigateLastPage}" begin="${pi.navigateFirstPage}" varStatus="i">
                                <li <c:if test="${pi.pageNum==i.current}">class="active"</c:if>>
                                    <a href="/emp?pageNum=${i.current}">${i.current}</a></li>
                                </c:forEach>
                                <li>
                                    <a href="/emp?pageNum=${pi.nextPage}">下一页</a>
                                </li>
                                <li>
                                    <a href="/emp?pageNum=${pi.pages}" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                            </ul>
                        </nav>
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>
</body>
</html>
